package com.springboot.config;

import com.google.common.base.Optional;
import io.shardingsphere.api.algorithm.sharding.ShardingValue;
import io.shardingsphere.api.algorithm.sharding.hint.HintShardingAlgorithm;
import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.util.buf.StringUtils;

import java.util.Collection;
import java.util.Collections;

/**
 * @Author: TongRui乀
 * @Date: 2019-12-30 14:08
 * @description：
 */
@Slf4j
public class DbAlgorithm implements HintShardingAlgorithm {

    public DbAlgorithm(){}


    @Override
    public Collection<String> doSharding(Collection<String> availableTargetNames, ShardingValue shardingValue) {

        return Collections.singletonList("db0");
    }
}
